<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>我是模板文件</title>
	</head>
	<body>
		{include file="head.html"}
		{$data.name}
		<hr />
		{$data.info.url}
		<hr />
		<!--我是注释-->
		{*我也是注释,我在浏览器源代码中不显示*}
		{$smarty.get.page}
		<hr />
		<!--常量调用-->
		{$smarty.const.APP}
		<hr />
		<!--获取当前时间-->
		{$smarty.now}
		<hr />
		<!--格式化时间戳-->
		{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
		<hr />
		{*第一参数|函数:第二参数*}
		{$smarty.get.page|default:"我是page参数的默认值"}
		<hr />
		{*参数|函数：参数|函数：参数*}
		{$letter|upper|lower}
		<hr />
		{$letter|truncate:5:""}
		<hr />
		{literal}
			{if $data.name=="小红" && $data.age==19}
				我才是小红
			{else}
				我是小绿
			{/if}
		{/literal}
		<hr />
		<table border="1" >
			<tr>
				<th>学生姓名</th>
				<th>性别</th>
				<th>年龄</th>
			</tr>
			{foreach from=$stuData key=k item=v}
			<tr>
				<td>{$v.name}</td>
				<td>{$v.sex}</td>
				<td>{$v.age}</td>
			</tr>
			{/foreach}
		</table>
		<hr />
		<table border="1" >
			<tr>
				<th>学生姓名</th>
				<th>性别</th>
				<th>年龄</th>
			</tr>
			{section loop=$stuData name=m start=1 step=3 max=5}
			<tr>
				<td>{$stuData[m].name}</td>
				<td>{$stuData[m].sex}</td>
				<td>{$stuData[m].age}</td>
			</tr>
			{/section}
		</table>
		<hr />
		<table border="1" >
			<tr>
				<th>学生姓名</th>
				<th>性别</th>
				<th>年龄</th>
			</tr>
			{section loop=$stuData name=m}
				{if $smarty.section.m.last}
				<tr style="color: red;">
					<td>{$stuData[m].name}</td>
					<td>{$stuData[m].sex}</td>
					<td>{$stuData[m].age}</td>
				</tr>
				{else}
				<tr>
					<td>{$stuData[m].name}</td>
					<td>{$stuData[m].sex}</td>
					<td>{$stuData[m].age}</td>
				</tr>
				{/if}
			{/section}
		</table>
		<hr />
		<table border="1" >
			<tr>
				<th>学生姓名</th>
				<th>性别</th>
				<th>年龄</th>
			</tr>
			{section loop=$stuData name=m}
				{if $smarty.section.m.index<=3}
				<tr style="color: red;">
					<td>{$stuData[m].name}</td>
					<td>{$stuData[m].sex}</td>
					<td>{$stuData[m].age}</td>
				</tr>
				{else}
				<tr>
					<td>{$stuData[m].name}</td>
					<td>{$stuData[m].sex}</td>
					<td>{$stuData[m].age}</td>
				</tr>
				{/if}
			{/section}
		</table>
		<hr />
		{include file="footer.html"}
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
	</body>
</html>
